<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../common/taglibs.jsp"%>
<!-- 
    Copyright (C)  2011  chen wei hua.
    Permission is granted to copy, distribute and/or modify this document
    under the terms of the GNU Free Documentation License, Version 2.0
    or any later version published by the Free Software Foundation;
    with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
    A copy of the license is included in the section entitled "GNU Free Documentation License".
 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>成品交运单一览</title>
<%@ include file="../common/config.jsp"%>
<%@ include file="../common/pageable.jsp"%>
<%@ include file="../common/autocomplete.jsp"%>
<script type="text/javascript" src="js/calendar/WdatePicker.js" ></script>
<script type="text/javascript">
    function pageselectCallback(page_index, jq){
    	var oldPageIndex = $("#pageInfo_pageIndex").val();
        if (page_index != oldPageIndex) {
        	$("#pageInfo_pageIndex").val(page_index);
        	$("#deliveryOrderList").submit();
        }
        return false;
    }

     function querySubmit() {
    	 $("#pageInfo_pageIndex").val("0");
    	 $("#deliveryOrderList").submit();
    	 return false;
     }

     $(document).ready(function() {
    		$("#condition_logisticsName").autocomplete("queryLogisticsNames.action", {
    			width: 200,
    			max: 10,
    			autoFill: false,
    			dataType: "json",
    			parse: function(data) {
    				var parsed = [];
    				var rows = data.logisticsList;
    				for (var i=0; i < rows.length; i++) {
    					var row = rows[i];
    					if (row) {
    						parsed[parsed.length] = {
    							data: row,
    							value: row[0],
    							result: row[1]//最终选择后显示的内容
    						};
    					}
    				}
    				return parsed;
    			},
    			formatItem: function(row, i, max) {
    				return row[1];//列表中显示的值
    			}
    		}).result(function(e, row) {
    			//alert(row[0]);//最终选择的ID
    			$(e.target).next().val(row[0]);
    		});
    	});

</script>
</head>

<body>
    <div class="subnav" align="left">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td width="100%" align="left" height="31">&nbsp;<img src="images/title-pk.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt1">订单管理</span>
			&nbsp;<img src="images/leftico2.gif" border="0"  align="absmiddle"/>&nbsp;<span class="subnavtxt2">成品交运单一览</span></td>
		  </tr>
		</table>
      </div>
   <div class="divborder">
      <s:form action="deliveryOrderList" name="condition">
      <s:hidden id="pageInfo_pageIndex" name="pageInfo.pageIndex" />
        <table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr>
            <td width="10%" align="right">日期</td>
            <td width="40%">
              <s:textfield name="condition.beginDate" size="10" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" >
                <s:param name="value" ><s:date name="condition.beginDate" format="yyyy-MM-dd" /></s:param>
              </s:textfield>
    		  -<s:textfield name="condition.endDate" size="10" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" readonly="true" >
    		    <s:param name="value" ><s:date name="condition.endDate" format="yyyy-MM-dd" /></s:param>
    		  </s:textfield>
            </td>
            <td width="10%" align="right">物流公司</td>
            <td width="10%">
              <s:textfield id="condition_logisticsName" name="condition.logisticsName" size="20" />
              <s:hidden id="condition_logisticsId" name="condition.logisticsId" />
            </td>
            <td align="right"><input name="button" type="button" class="input1" value="查 询" onclick="querySubmit()"/></td>
          </tr>
        </table>
      </s:form>
  </div >        
  <div class="ksglxx2">
        <table width="100%" cellpadding="0" cellspacing="1" border="0" class="ksglxx2a">
          <tr class="ksglxx2bg">
             <th width="10%" align="left">单号</th>
             <th width="10%" align="left">发货日期</th>
             <th width="30%" align="left">客户名称</th>
             <th width="10%" align="left">总金额</th>
             <th align="10%" align="left">运输公司</th>
             <th align="10%" align="left">毛重(kg)</th>
             <th align="10%" align="left">体积(m2)</th>
             <th></th>
          </tr>
		<s:iterator value="orderList" id="order" status="st">
           <s:if test="#st.Odd">
             <tr class="odd">
              <td><span class="detail">
                <a href='deliveryOrderInfo.action?orderId=<s:property value="#order.id" />'><s:property value="#order.orderNo" /></a>
              </span></td>
              <td><s:date name="#order.deliveryDate" format="yyyy-MM-dd"/></td>
              <td><s:property value="#order.customName" /></td>
              <td><s:property value="#order.totleAmount" /></td>
              <td><s:property value="#order.logisticsName" /></td>
              <td><s:property value="#order.totleWeight" /></td>
              <td><s:property value="#order.totleVolume" /></td>
              <td></td>
             </tr>
           </s:if>
           <s:else>
             <tr class="even">
              <td><span class="detail">
                <a href='deliveryOrderInfo.action?orderId=<s:property value="#order.id" />'><s:property value="#order.orderNo" /></a>
              </span></td>
              <td><s:date name="#order.deliveryDate" format="yyyy-MM-dd"/></td>
              <td><s:property value="#order.customName" /></td>
              <td><s:property value="#order.totleAmount" /></td>
              <td><s:property value="#order.logisticsName" /></td>
              <td><s:property value="#order.totleWeight" /></td>
              <td><s:property value="#order.totleVolume" /></td>
              <td></td>
             </tr>
           </s:else>
		</s:iterator>
      </table>
		<!--分页开始-->
		<div style="float:right;">
			<br style="clear:both;" /> 
			<div id="Pagination"></div> 
		</div>
		<!--分页结束-->
  </div>
</body>
</html>
